const cloud = require('wx-server-sdk')

cloud.init({
	env: cloud.DYNAMIC_CURRENT_ENV,
})

exports.main = async (event) => {
	try {
		const space = await cloud.database().collection('gn_space').where(event).get()

		return {
			data: space.data,
			code: 0,
			msg: '查询成功',
		}
	} catch (err) {
		throw err
	}
}
